package com.amikomgamedev.labirinhantu.sound;

import android.content.Context;

import com.amikomgamedev.labirinhantu.Server_Data;

public class Sound_Manager extends Sound_Load
{
	public Sound_Manager(Context context)
	{
		super(context);
	}

	public void playMenuBgm()
	{
		if (Server_Data.isSoundEnable())
		{
		    if (bgm_Menu != null)
			bgm_Menu.play();
		}

		return;
	}
	
	public void stopMenuBgm()
	{
	    if (bgm_Menu != null)
		if (bgm_Menu.isPlaying())
		{
			bgm_Menu.pause();
			bgm_Menu.seekTo(0);
		}
	}
	
	public void playGameBgm(int stage)
	{
		if(Server_Data.isSoundEnable())
		{
		    if (bgm_Game[stage] != null)
			bgm_Game[stage].play();
		}
	}
	
	public void stopGameBgm(int stage)
	{
	    if (bgm_Game[stage] != null)
		if (bgm_Game[stage].isPlaying())
		{
		    bgm_Game[stage].pause();
		    bgm_Game[stage].seekTo(0);
		}
	}
	
	public void playGameSfx(int index)
	{
		if (Server_Data.isSoundEnable())
		{
		    if (sfx_Game[index] != null)
			sfx_Game[index].play();
		}

		return;
	}
}
